package com.bsoft.gol.hcs.common.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "sys_log")
public class SysLogEntity {
    private long logUnid;
    private String organizationId;
    private String logCractUnid;
    private String logCractUname;
    private String logThread;
    private String logType;
    private String loginName;
    private String logUserId;
    private String logUserName;
    private String roleId;
    private String roleName;
    private String logModuleName;
    private String logMethodSign;
    private String logServerName;
    private String logDesc;
    private String logparameter;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh_CN", timezone = "GMT+8")
    private Date logCdate;
    private String logIp;
    private String logMACAddress;
    private String logresCode;
    private String logClentOS;
    private String logClentBrowser;
    private String logDoctorCode;
    private String patientMedicalCardNumber;
    private long patientMedicalCardType;


    @Id
    @Column(name = "logUnid")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public long getLogUnid() {
        return logUnid;
    }

    public void setLogUnid(long logUnid) {
        this.logUnid = logUnid;
    }

    @Basic
    @Column(name = "logCractUnid")
    public String getLogCractUnid() {
        return logCractUnid;
    }

    public void setLogCractUnid(String logCractUnid) {
        this.logCractUnid = logCractUnid;
    }

    @Basic
    @Column(name = "logCractUname")
    public String getLogCractUname() {
        return logCractUname;
    }

    public void setLogCractUname(String logCractUname) {
        this.logCractUname = logCractUname;
    }

    @Basic
    @Column(name = "logThread")
    public String getLogThread() {
        return logThread;
    }

    public void setLogThread(String logThread) {
        this.logThread = logThread;
    }

    @Basic
    @Column(name = "logType")
    public String getLogType() {
        return logType;
    }

    public void setLogType(String logType) {
        this.logType = logType;
    }

    @Basic
    @Column(name = "logmodulename")
    public String getLogModuleName() {
        return logModuleName;
    }

    public void setLogModuleName(String logModuleName) {
        this.logModuleName = logModuleName;
    }

    @Basic
    @Column(name = "logMethodSign")
    public String getLogMethodSign() {
        return logMethodSign;
    }

    public void setLogMethodSign(String logMethodSign) {
        this.logMethodSign = logMethodSign;
    }

    @Basic
    @Column(name = "logServerName")
    public String getLogServerName() {
        return logServerName;
    }

    public void setLogServerName(String logServerName) {
        this.logServerName = logServerName;
    }

    @Basic
    @Column(name = "logDesc")
    public String getLogDesc() {
        return logDesc;
    }

    public void setLogDesc(String logDesc) {
        this.logDesc = logDesc;
    }

    @Basic
    @Column(name = "logparameter")
    public String getLogparameter() {
        return logparameter;
    }

    public void setLogparameter(String logparameter) {
        this.logparameter = logparameter;
    }

    @Basic
    @Column(name = "logCdate")
    public Date getLogCdate() {
        return logCdate;
    }

    public void setLogCdate(Date logCdate) {
        this.logCdate = logCdate;
    }

    @Basic
    @Column(name = "logIp")
    public String getLogIp() {
        return logIp;
    }

    public void setLogIp(String logIp) {
        this.logIp = logIp;
    }

    @Basic
    @Column(name = "logMACAddress")
    public String getLogMACAddress() {  return logMACAddress; }

    public void setLogMACAddress(String logMACAddress) { this.logMACAddress = logMACAddress; }

    @Basic
    @Column(name = "logresCode")
    public String getLogresCode() {
        return logresCode;
    }

    public void setLogresCode(String logresCode) {
        this.logresCode = logresCode;
    }

    @Basic
    @Column(name = "logClentOS")
    public String getLogClentOS() {
        return logClentOS;
    }

    public void setLogClentOS(String logClentOS) {
        this.logClentOS = logClentOS;
    }

    @Basic
    @Column(name = "logClentBrowser")
    public String getLogClentBrowser() {
        return logClentBrowser;
    }

    public void setLogClentBrowser(String logClentBrowser) {
        this.logClentBrowser = logClentBrowser;
    }

    @Basic
    @Column(name = "organizationId")
    public String getOrganizationId() {return organizationId;}

    public void setOrganizationId(String organizationId) { this.organizationId = organizationId;}

    @Basic
    @Column(name = "loginName")
    public String getLoginName() { return loginName;}

    public void setLoginName(String loginName) { this.loginName = loginName;}

    @Basic
    @Column(name = "logUserId")
    public String getLogUserId() { return logUserId; }

    public void setLogUserId(String logUserId) { this.logUserId = logUserId;    }

    @Basic
    @Column(name = "logUserName")
    public String getLogUserName() { return logUserName;    }

    public void setLogUserName(String logUserName) {  this.logUserName = logUserName;    }

    @Basic
    @Column(name = "roleId")
    public String getRoleId() {   return roleId;    }

    public void setRoleId(String roleId) {   this.roleId = roleId;    }

    @Basic
    @Column(name = "roleName")
    public String getRoleName() {  return roleName;    }

    public void setRoleName(String roleName) { this.roleName = roleName;  }

    @Basic
    @Column(name = "logDoctorCode")
    public String getLogDoctorCode() { return logDoctorCode; }
    public void setLogDoctorCode(String logDoctorCode) {  this.logDoctorCode = logDoctorCode;    }


    @Basic
    @Column(name = "patientMedicalCardNumber")
    public String getPatientMedicalCardNumber() { return patientMedicalCardNumber; }
    public void setPatientMedicalCardNumber(String patientMedicalCardNumber) {
        this.patientMedicalCardNumber = patientMedicalCardNumber;
    }

    @Basic
    @Column(name = "patientMedicalCardType")
    public long getPatientMedicalCardType() { return patientMedicalCardType; }
    public void setPatientMedicalCardType(long patientMedicalCardType) {
        this.patientMedicalCardType = patientMedicalCardType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        SysLogEntity that = (SysLogEntity) o;

        if (logUnid != that.logUnid) {
            return false;
        }
        if (logCractUnid != null ? !logCractUnid.equals(that.logCractUnid) : that.logCractUnid != null) {
            return false;
        }
        if (logCractUname != null ? !logCractUname.equals(that.logCractUname) : that.logCractUname != null) {
            return false;
        }
        if (logThread != null ? !logThread.equals(that.logThread) : that.logThread != null) {
            return false;
        }
        if (logType != null ? !logType.equals(that.logType) : that.logType != null) {
            return false;
        }
        if (logModuleName != null ? !logModuleName.equals(that.logModuleName) : that.logModuleName != null) {
            return false;
        }
        if (logMethodSign != null ? !logMethodSign.equals(that.logMethodSign) : that.logMethodSign != null) {
            return false;
        }
        if (logServerName != null ? !logServerName.equals(that.logServerName) : that.logServerName != null) {
            return false;
        }
        if (logDesc != null ? !logDesc.equals(that.logDesc) : that.logDesc != null) {
            return false;
        }
        if (logparameter != null ? !logparameter.equals(that.logparameter) : that.logparameter != null) {
            return false;
        }
        if (logCdate != null ? !logCdate.equals(that.logCdate) : that.logCdate != null) {
            return false;
        }
        if (logIp != null ? !logIp.equals(that.logIp) : that.logIp != null) {
            return false;
        }
        if (logMACAddress != null ? !logMACAddress.equals(that.logMACAddress) : that.logMACAddress != null) {
            return false;
        }
        if (logresCode != null ? !logresCode.equals(that.logresCode) : that.logresCode != null) {
            return false;
        }
        if (logClentOS != null ? !logClentOS.equals(that.logClentOS) : that.logClentOS != null) {
            return false;
        }
        if (logClentBrowser != null ? !logClentBrowser.equals(that.logClentBrowser) : that.logClentBrowser != null) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (logUnid ^ (logUnid >>> 32));
        result = 31 * result + (logCractUnid != null ? logCractUnid.hashCode() : 0);
        result = 31 * result + (logCractUname != null ? logCractUname.hashCode() : 0);
        result = 31 * result + (logThread != null ? logThread.hashCode() : 0);
        result = 31 * result + (logType != null ? logType.hashCode() : 0);
        result = 31 * result + (logModuleName != null ? logModuleName.hashCode() : 0);
        result = 31 * result + (logMethodSign != null ? logMethodSign.hashCode() : 0);
        result = 31 * result + (logServerName != null ? logServerName.hashCode() : 0);
        result = 31 * result + (logDesc != null ? logDesc.hashCode() : 0);
        result = 31 * result + (logparameter != null ? logparameter.hashCode() : 0);
        result = 31 * result + (logCdate != null ? logCdate.hashCode() : 0);
        result = 31 * result + (logIp != null ? logIp.hashCode() : 0);
        result = 31 * result + (logMACAddress != null ? logMACAddress.hashCode() : 0);
        result = 31 * result + (logresCode != null ? logresCode.hashCode() : 0);
        result = 31 * result + (logClentOS != null ? logClentOS.hashCode() : 0);
        result = 31 * result + (logClentBrowser != null ? logClentBrowser.hashCode() : 0);
        return result;
    }
}
